/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved.
 * ProjectName: qolome-knowledge
 * FileName: ConcretePrototype.java
 * Author: jiangfeng@qolome.com
 * Date: 2020/3/1 下午3:54
 * LastModified: 2020/03/01 15:36:01
 */

package com.qolome.knowledge.design.pattern.prototype.deep;


import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Qolome
 * @version V1.0
 * @Description 深克隆
 * @date 2020年 03月01日 15:32:08
 */

@Slf4j
public class Test {

    public static void main(String[] args) throws IOException, ClassNotFoundException {

        ConcretePrototype concretePrototype = new ConcretePrototype();
        concretePrototype.setAge(2);
        concretePrototype.setName("Tom");
        List<String> hobbies = new ArrayList<>();
        log.info("concretePrototype:{}",concretePrototype);
        hobbies.add("吃饭");
        concretePrototype.setHobbies(hobbies);
        ConcretePrototype clone = concretePrototype.deepClone();
        log.info("clone:{}",clone);



    }


}
